import { Router } from 'express'
const qr = require('qr-image')
const router = Router()
router.get('/qr', (req, res) => {
  const text = req.query.text
  const img = qr.image(text, { type: 'png', size: 10 })
  res.writeHead(200, { 'Content-Type': 'image/png' })
  img.pipe(res)
})

export default router
